#!/usr/bin/env bash
# 把代码分别copy到不同git项目并上传


ROOT=/Users/apple/storj/tmp
commitText="p2p参数从配置文件中设置"
cd ..
# common
commitProject(){
  dir=$1
  src=$2
  dist=$ROOT/$dir
  echo "copy " $src " to " $dist
  cd $src
  cp -r * $dist
  cd $dist
  git ci -a -m$commitText
  git push
  cd -
  cd ..
  echo `pwd`
}
commitProject 'common'  'common'
commitProject 'private' 'private2'
commitProject 'uplink' 'uplink-1.7.0'
commitProject 'drpc' 'drpc'

rsync -av --exclude='common/' --exclude='.DS_Store' --exclude='.git/' --exclude='.idea/' --exclude='drpc/'  --exclude='private2/'  --exclude='uplink-1.7.0/'    .  $ROOT/storj
cd $ROOT/storj
git ci -a -m$commitText
git push
cd -
echo "ok"
